using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace BABILON
{
    class Program
    {
        static void Main(string[] args)
        {
            int A;
            int B;
            int C;

            int nl_Padion =0;
            int nl_Zattacker=0;
            int nl_Carrier=0;

            int tongNangLuong = 0;

            List<Robot> lstRobot;
            NhapDoanRoBot(out A, out B, out C, out lstRobot);
            //List<Carrier> arrPadion = new List<Carrier>(C);
            // Di chuyen den noi can khai pha khai pha
            foreach(Robot rb in lstRobot)
            {
                rb.DiChuyen(10);
            }

            Console.WriteLine("Xuat thong tin cua doan robot sau khi khai pha:");
            for (int i = 0; i < lstRobot.Count; i++ )
            {
                lstRobot[i].XuatThongTin();
                tongNangLuong += lstRobot[i].NangLuongTieuThu;
                Console.Write("\n");
            }
            
//            int maxnangluong = nl_Padion;
//            String loaimax = "Padion";
//            if(nl_Zattacker > maxnangluong){
//                loaimax = "Zattacker";
//                maxnangluong = nl_Zattacker;
//            }
//                if (nl_Carrier > maxnangluong)
//                {
//                    loaimax = "Carrier";
//                    maxnangluong = nl_Carrier;
//                }
            
//            //int tongnangluong = nl_Padion + nl_Zattacker + nl_Carrier;
//            Console.WriteLine("Tong nang luong tieu thu:" + tongNangLuong);
//            Console.WriteLine("Loai robot tieu thu nhieu nang luong nhat:" + loaimax + " voi tong nang luong la:" + maxnangluong);
////            Console.WriteLine("");

        }

        private static void NhapDoanRoBot(out int A, out int B, out int C, out List<Robot> lstRobot)
        {
            lstRobot = new List<Robot>();

            Console.Write("Nhap vao so robot Padion: ");
            A = int.Parse(Console.ReadLine());
            for (int i = 0; i < A; i++)
            {
                lstRobot.Add(new Pedion());
            }
            
            Console.Write("Nhap vao so robot Zattacker: ");
            B = int.Parse(Console.ReadLine());
            for (int i = 0; i < B; i++)
            {
                lstRobot.Add(new Zattacker());
            }

            Console.Write("Nhap vao so robot Carrier: ");
            C = int.Parse(Console.ReadLine());
            for (int i = 0; i < C; i++)
            {
                lstRobot.Add(new Carrier());
            }
        }
    }
}
